<template>
  <div class="container">
    <DataList
      ref="dataList"
      :propAutoFetchData="true"
      :propNoCheck="true"
      :propSearchFields="['title','receiverName','receiver']"
      :propSearchTextAppend="'消息类型/接收者名称/接收者账号'"
      propUrl="/msg/pushed_records/pageCommon"
      showFieldPk="id"
      :isOnlyShow="true"
      :showDataFmtFun="showDataFmtFun"
      :vanFieldLabelWith5="true"
      :showFieldList="cpShowFieldList"
      :sortDefault="{field: 'gmtCreate',type: 'desc'}"
      :detailFormConfig="{enabled: true, title: '消息详情'}"
    >
    </DataList>
  </div>
</template>

<script>

export default {
  help: '微信消息-列表',
  data() {
    return {
    }
  },
  methods: {
    showDataFmtFun(data) {
      data.forEach(item => {
      })
      return data
    }
  },
  computed: {
    // 主单据显示字段
    cpShowFieldList() {
      let fieldList = [
        { label: '消息标题', name: 'title', span: 24, isTitle: true },
        { label: '接收者名称', name: 'receiverName', span: 24 },
        { label: '接收者账号', name: 'receiver', span: 12 },
        { label: '消息内容', name: 'content', span: 24, autosize: true, type: 'textarea',queryType: this.constCommon.formItemType.textarea.name },
        { label: 'openid', name: 'openid', span: 24 },
        {
          label: '推送时间', name: 'gmtCreate', span: 24,
          queryType: this.constCommon.formItemType.datePickerBetween.name,
          queryConfig: {
            format: this.dates.defaultDateTimePattern
          }
        },
        {
          label: '推送成功', name: 'isSuccess', span: 24,flagBoolean: true,isTitleSub: true,
          queryType: this.constCommon.formItemType.switch.name,isTitleSubWithLabel: true,
          queryConfig: {
            dictType: this.constCommon.dictType.commonYesNo
          }
        },
        { label: '异常信息', name: 'exceptionMsg', span: 24, autosize: true, type: 'textarea',queryType: this.constCommon.formItemType.textarea.name }
      ]

      return fieldList
    }
  }
}
</script>
